﻿<!----*******----->
//
function closeDiv()
{
	document.getElementById('eMeng').style.visibility='hidden';
	if(objTimer) window.clearInterval(objTimer)
}
//
function closewin(rtnValue)
{
window.returnValue=rtnValue;
window.close();
}
//
function shutwin(){opener=null;self.close();}

//
function flashit(obj,i){
	var mys = document.getElementById(obj);
	//alert(obj);
	if (!document.all)
		return
	if (i==0){
		mys.style.borderColor="#FF9933";
	}else{
		mys.style.borderColor="#ffffff";
	}
}
//-->

var Obj=''
document.onmouseup=MUp

function MDown(Object){
Obj=Object.id
document.all(Obj).setCapture()
pX=event.x-document.all(Obj).style.pixelLeft;
pY=event.y-document.all(Obj).style.pixelTop;
}

function MUp(){
if(Obj!=''){
	document.all(Obj).releaseCapture();
	Obj='';
	}
}

//
function scroll(n)
{temp=n;
msg.scrollTop=msg.scrollTop+temp;
if (temp==0) return;
setTimeout("scroll(temp)",0);
}

//-->

//
var old=1;
function btn_change(i){
	old=i
}
function btn_change_over(i){
	var new_td11="btn1_"+i+"1";
	var new_td21="btn1_"+i+"2";
	var new_td31="btn1_"+i+"3";
    if(eval("document.all."+new_td21).className=='buttonUnEditMiddle'){
	       return false;
	 }
	eval("document.all."+new_td11).className="buttonOnLeft";
	eval("document.all."+new_td21).className="buttonOnMiddle";
	eval("document.all."+new_td31).className="buttonOnRight";
 }
function btn_change_out(i){
	var new_td11="btn1_"+i+"1";
	var new_td21="btn1_"+i+"2";
	var new_td31="btn1_"+i+"3";
	if(eval("document.all."+new_td21).className=='buttonUnEditMiddle'){
	       return false;
	 }
	eval("document.all."+new_td11).className="buttonOffLeft";
	eval("document.all."+new_td21).className="buttonOffMiddle";
	eval("document.all."+new_td31).className="buttonOffRight";
 }

 function btn_change_Edit(i){
	var new_td11="btn1_"+i+"1";
	var new_td21="btn1_"+i+"2";
	var new_td31="btn1_"+i+"3";
	eval("document.all.img_"+new_td21).src=PROJECT_NAME_PATH_MYCE+"/images/ico_ok.gif"
	eval("document.all."+new_td11).className="buttonOffLeft";
	eval("document.all."+new_td21).className="buttonOffMiddle";
	eval("document.all."+new_td31).className="buttonOffRight";
 }

 function btn_change_UnEdit(i){

	var new_td11="btn1_"+i+"1";
	var new_td21="btn1_"+i+"2";
	var new_td31="btn1_"+i+"3";
	eval("document.all.img_"+new_td21).src=PROJECT_NAME_PATH_MYCE+"/images/ico_ok_gray.gif"
	eval("document.all."+new_td11).className="buttonUnEditLeft";
	eval("document.all."+new_td21).className="buttonUnEditMiddle";
	eval("document.all."+new_td31).className="buttonUnEditRight";

 }

function btn_UnEdit(btnId,imagesId,imagesName){
	eval("document.all."+imagesId).src=PROJECT_NAME_PATH_MYCE+"/images/"+imagesName+".gif"
    eval("document.all."+btnId).className="quickMenu_toolbarico2";
}

function btn_Edit(btnId,imagesId,imagesName){
	eval("document.all."+imagesId).src=PROJECT_NAME_PATH_MYCE+"/images/"+imagesName+".gif"
	eval("document.all."+btnId).className="toolbarico";
}

 function freshEditList(){

 	 document.forms.ec.ec_p.value=document.getElementById("ec_p").value;
	 document.forms.ec.submit();
 }


//
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){}
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg()
{
	var speed=10;//
	try{
	divTop = parseInt(document.getElementById("eMeng").style.top,10)
	divLeft = parseInt(document.getElementById("eMeng").style.left,10)
	divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)//
	divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)//
	docWidth = document.body.clientWidth;
	docHeight = document.body.clientHeight;
	document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;//
	document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth//
	document.getElementById("eMeng").style.visibility="visible"
	objTimer = window.setInterval("moveDiv()",speed)//
	}
	catch(e){}
}

function resizeDiv()
{
	var stopTimes=200;//
	i+=1;
	if(i>stopTimes) closeDiv()	;
	try{
			divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
			divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
			docWidth = document.body.clientWidth;
			docHeight = document.body.clientHeight;
			document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
			document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
		}
	catch(e){}
}

function moveDiv()
{
	try
	{
	if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
	{
		var multipleTimes=1;
		window.clearInterval(objTimer)
		objTimer = window.setInterval("resizeDiv()",multipleTimes);
	}
		divTop = parseInt(document.getElementById("eMeng").style.top,10)
		document.getElementById("eMeng").style.top = divTop - 1
	}
	catch(e){}
}

function closeDiv()
{
	document.getElementById('eMeng').style.visibility='hidden';
	if(objTimer) window.clearInterval(objTimer)
}


function showFull(){
	var imageName=document.all.item("full_image").src;
	if(imageName.indexOf("ico_fullscreen.gif")!=-1){
		parent.document.all.item("div_header").style.display="none";
		parent.document.all.item("div_footer").style.display="none";
		document.all.item("full_image").src="../images/ico_returnNormal.gif";
	}else{
		parent.document.all.item("div_header").style.display="";
		parent.document.all.item("div_footer").style.display="";
		document.all.item("full_image").src="../images/ico_fullscreen.gif";
	}
}
function showFull_in(){
	var imageName=document.all.item("full_image").src;
	if(imageName.indexOf("ico_fullscreen.gif")!=-1){
		parent.document.all.item("div_header").style.display="none";
		parent.document.all.item("div_footer").style.display="none";
		document.all.item("full_image").src=PROJECT_NAME_PATH_MYCE + "/images/ico_returnNormal.gif";
	}else{
		parent.document.all.item("div_header").style.display="";
		parent.document.all.item("div_footer").style.display="";
		document.all.item("full_image").src=PROJECT_NAME_PATH_MYCE + "/images/ico_fullscreen.gif";
	}
}

function child_btnDel(){
	parentWin.document.all.item("msg1_21").style.display="none";
}


function displayyes(imagesID)
{
	document.getElementById(imagesID).style.display="";
}
function displayno(imagesID)
{
	document.getElementById(imagesID).style.display="none";
}


function edit(){
 var obj = window.event.srcElement;
 obj.className = 'inputtext';
 obj.readOnly = false;
 obj.focus();
}
function edit1(){
 var obj = window.event.srcElement;
 obj.className = 'inputtext';
 obj.readOnly = false;
 obj.focus();
}
function edit2(){
 var obj = window.event.srcElement;
 obj.className = 'inputtext';
 obj.readOnly = false;
 obj.focus();
}
function exitEdit(){
 var obj = window.event.srcElement;
 obj.className = 'input_read';
 obj.readOnly = true;
 obj.focus();
}

//------------------------------
function resizewindow(width,height)
{
	self.resizeTo(width,height);
}



 function checkradio(radioID,divID)
 {
	radiolist=document.getElementsByName(radioID)
	for(i=0;i<radiolist.length;i++)
	{
	if(radiolist[i].checked)
		{
			document.getElementById(divID).innerHTML=radiolist[i].value;
		}
	}
}

function distable(hiddenID,showID)
{
	document.getElementById(hiddenID).style.display="none";
	document.getElementById(showID).style.display="";
	}



function openwin(src,winwidth,height)
{
var x=(screen.width-winwidth)/2;
var y=(screen.height-height)/2;
window.open(src,'',"width="+winwidth+",height="+height+",left="+x+",top="+y+",resizable=yes");
}

function openModwin(src,width,height)
{
window.showModalDialog(src,window,"dialogWidth:"+width+"px;dialogHeight:"+height+"px;help:no;status:no;scroll:no;certer");
}

function openModlesswin(src,width,height)
{
window.showModelessDialog(src,window,"dialogWidth:"+width+"px;dialogHeight:"+height+"px;help:no;status:no;scroll:no;certer");
}

function showdivcontent(ID,e)
{
	screenx=window.screen.width;
	var thistop=e.offsetTop;
	var thisleft=e.offsetLeft;
	while(e=e.offsetParent)
	{
		thistop+=e.offsetTop;
		thisleft+=e.offsetLeft;
	}
	dgetID=document.getElementById(ID);
	dgetID.style.display="block";
	dgetID.style.left=(screenx-800)/2;
	dgetID.style.top=thistop;
}
function hiddendivcontent(ID)
{
	document.getElementById(ID).style.display="none";
}



function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


function SetDivPosition(obj)
{
	obj.style.top=window.event.y + 5;obj.style.left=window.event.x + 10;
}



function Pub_show_hide_2(obj1,obj2){
	obj1.style.display = "block";
	obj2.style.display = "none";
	}

function clickShowV(obj){
	obj.style.visibility = "visible";
}

function clickHideV(obj){
	obj.style.visibility = "hidden";
}

function clickShow(obj){
	obj.style.display = "block";
}

function clickHide(obj){
	obj.style.display = "none";
}


function show_policy(){
if (form.select.value=="1")
{
layer1.style.display="";
layer2.style.display="none";
layer3.style.display="none";
}
else{
layer1.style.display="none";

}
if (form.select.value=="2") //
{
layer2.style.display="";
layer1.style.display="none";
layer3.style.display="none";
}
else{
layer2.style.display="none";

}
if (form.select.value=="3") //
{
layer3.style.display="";
layer1.style.display="none";
layer2.style.display="none";
}
else{
layer3.style.display="none";

}
}


function look(abc)
{
if (abc==60){ abc=window.showModalDialog
('../../house/fcxx/Aux_look.htm',window,'dialogWidth:490px;dialogHeight:620px;help:no;status:no;scroll:no;center');
	}
if (abc==61){ abc=window.showModalDialog
('../../house/fcxx/Aux_look2.htm',window,'dialogWidth:300px;dialogHeight:410px;help:no;status:no;scroll:no;center');
	}
}



function show_gjsearch(){
if (form.select.value=="1")
{
layer1.style.display="";
layer2.style.display="none";
}
else{
layer2.style.display="";
layer1.style.display="none";
}

}

